package com.orhonit.ipb.portal.biz;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.orhonit.ipb.portal.entity.TbPartyMemberBaseInfo;
import com.orhonit.ipb.portal.mapper.TbPartyMemberBaseInfoMapper;
import com.orhonit.ipb.security.common.biz.BaseBiz;


/**
 * 党员基础信息表
 *
 * @author caodw
 * @email caodw@qq.com
 * @version 2018-04-23 11:23:42
 */
@Service
public class TbPartyMemberBaseInfoBiz extends BaseBiz<TbPartyMemberBaseInfoMapper,TbPartyMemberBaseInfo> {

	@Autowired
	private TbPartyMemberBaseInfoMapper tbPartyMemberBaseInfoMapper;

	/**
	 * 通过用户id更新所在支部
	 * @param map placePartyBranch userId
	 * @return
	 */
	@Transactional(rollbackFor = Exception.class)
	public boolean updateTbPartyMemberBaseInfoDeptByUserId(Map<String, Object> map){
		boolean a=false;
		int count=tbPartyMemberBaseInfoMapper.updateTbPartyMemberBaseInfoDeptByUserId(map);
		if(count>0){
			a=true;
		}
		return a;
	}
	/**
	 * 通过用户id更新党员状态
	 * @param map pmType userId
	 * @return
	 */
	@Transactional(rollbackFor = Exception.class)
	public boolean updateTbPartyMemberBaseInfopmTypeByUserId(Map<String, Object> map){
		boolean a=false;
		int count=tbPartyMemberBaseInfoMapper.updateTbPartyMemberBaseInfopmTypeByUserId(map);
		if(count>0){
			a=true;
		}
		return a;
	}
}